<template>
    <div class="w1200 main">
        <input class="search" type="text" v-model="search">
        <div class="content">{{search}}</div>
    </div>
</template>
<script>
export default {
    name:'detail',
    layout:'index',
    //middleware:'index',
    head: {
        title: '详情'
    },
    data(){
        return{
            search:''
        }
    },
    watch:{
        search (value) {
            const route={
                name:'detail'
            }
            if(this.search!=''){
                route.query={
                    search:this.search
                }
            }
            this.$router.push(route);
        }/*,
        '$route.query.search':{
            immediate:true,
            hanlder(value){
                this.search = value
            }
        }*/
    },
    mounted(){
        //console.log(this.$route.name);
    }
}
</script>
<style scoped>
    .main{
        min-height: 12.962963rem;
    }
    .search{
        width:7.407407rem;
        height: .925926rem;
        text-align: center;
        margin: .555556rem auto;
        display: block;
    }
</style>